<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>立方体设计transform使用</title>
    <style>
        .box {
            width: 200px;
            height: 200px;
            position: relative;
            perspective: 1000px;
            transform-style: preserve-3d;
        }
        
        .box:hover {
            transform: translate(150px, 100px) rotateX(-30deg) rotateY(30deg);
        }
        
        .box div {
            background-color: aqua;
            font-size: 10px;
            text-align: center;
            width: 200px;
            height: 200px;
            border: 1px solid #fff;
            box-sizing: border-box;
            line-height: 200px;
            position: absolute;
            opacity: 0.5;
        }
        
        .front:hover {
            transform: translateZ(100px);
            background: pink;
        }
        
        .back {
            transform: translateZ(-100px);
        }
        
        .left {
            transform: rotateY(90deg) translateZ(-100px);
        }
        
        .right {
            transform: rotateY(90deg) translateZ(100px);
        }
        
        .top {
            transform: rotateX(90deg) translateZ(100px);
        }
        
        .bottom {
            transform: rotateX(90deg) translateZ(-100px);
        }
    </style>
</head>

<body>
    <div class="box">
        <div class="front">
            <p class="fontText">
                我思故我在
            </p>
        </div>
        <div class="back">back</div>
        <div class="left">left</div>
        <div class="right">right</div>
        <div class="top">top</div>
        <div class="bottom">bottom</div>
    </div>
</body>

</html>